<template>
	<view class="swiper">
		<swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000">
			<swiper-item v-for="(item,index) in items" :key="index">
				<image :src="item.img" mode=""></image>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				items:[
					// {
					// 	img:"http://122.152.205.72:88/group1/M00/00/03/CpoxxFw1ZgSAdG-rAAfcNtoF_n8219.png"
					// },
					// {
					// 	img:"http://122.152.205.72:88/group1/M00/00/03/CpoxxFw1ZauAKb7sAAe1cnsz_BQ313.png"
					// },
					// {
					// 	img:"http://122.152.205.72:88/group1/M00/00/03/CpoxxFw1ZW6AHqLOAAe4KaofyAU209.png"
					// },
					// {
					// 	img:"http://122.152.205.72:88/group1/M00/00/03/CpoxxFw1ZHiASu_7AAfGb_KNy8Y861.png"
					// },
					// {
					// 	img:"http://122.152.205.72:88/group1/M00/00/03/CpoxxFw1ZSiAaDteAAdT5PsVWXs099.png"
					// }
				]
			};
		},
		methods:{
			getBanner(){
				wx.cloud.callFunction({
				  // 要调用的云函数名称
				  name: 'getCyygBanner'
				
				}).then(res => {
				 this.items = res.result.data
				}).catch(err => {
				  // handle error
				})
			}
		},
		mounted() {
			this.getBanner()
		}
	}
</script>

<style lang="scss" scoped>
	.swiper {
		width: 100%;
		height: 440upx;
	}

	swiper {
		width: 100%;
		height: 440upx;
	}

	image {
		width: 100%;
		height: 440upx;
	}
</style>
